extends Object
class_name  CommonUtil

static func load_tres(dir_path) -> Array:
	var dir = DirAccess.open(dir_path)
	dir.list_dir_begin()
	var file_name = dir.get_next()
	var tres_files = []
	
	while file_name != "":
		if dir.current_is_dir():
			dir.get_next()
			continue
		else:
			if file_name.ends_with(".tres"):
				var file_path = dir_path + "/" + file_name;
				print("发现资源文件" + file_name)
				var tres_resource = ResourceLoader.load(file_path)
				if tres_resource:
					tres_files.append(tres_resource)
		file_name = dir.get_next()
	dir.list_dir_end()
	return tres_files
